# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=simplify
pkgver=1.3.0
pkgrel=1
pkgdesc='Generic Android Deobfuscator.'
groups=('blackarch' 'blackarch-mobile')
arch=('any')
url='https://github.com/CalebFenton/simplify/releases'
license=('GPL3')
depends=('java-environment')
makedepends=('git')
source=("https://github.com/CalebFenton/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.jar")
sha512sums=('c2c16ab82a15434f279f24b7f2e062d62021999af6a3f4b188190f34391665d3dc3ec22aebcec56dc9f98269ee28c325687a1a0b5e10cc14dd0d299973440b3b')
install="$pkgname.install"

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "$pkgname-$pkgver.jar" \
    "$pkgdir/usr/share/$pkgname/$pkgname-$pkgver.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

